<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>切换显示与隐藏3</title>
    <style>
            #box{
                width: 200px;
                height: 200px;
                border: 1px solid #ccc;
                background: #810080;
            }
        </style>
    </head>
<body>
<input type="button" id="btn" value="切换">
<div id="box"></div>
</body>
</html>
<script src="js/jquery-1.10.1.js"></script>
<script>
    $(function () {
        $("#btn").click(function () {
            $("#box").toggle('slow')
        })
    })
</script>